home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / p_msys / msysb116.exe / CALLSRV0.C < prev    next >
Text File  |  1992-01-10  |  1KB  |  66 lines

  1. #define INTR 0xd1
  2. #include <dos.h>
  3. #include <stdio.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. #include <io.h>
  7. #include <fcntl.h>
  8. #include <time.h>
  9.  
  10.  
  11. /* COMPILE USING LARGE MEMORY MODEL USING TURBO C++ */
  12.  
  13. /* reduce heaplength and stacklength
  14. to make a smaller program in memory */
  15. extern unsigned _heaplen = 512;
  16. extern unsigned _stklen  = 2048;
  17.  
  18. unsigned mygetpsp()
  19. {
  20. union REGS regs;
  21. regs.x.ax=0x5100;
  22. int86(0x21,®s,®s);
  23. return regs.x.bx;
  24. }
  25.  
  26. mysetpsp(int pspadr)
  27. {
  28. union REGS regs;
  29. regs.x.ax= 0x5000;
  30. regs.x.bx= pspadr;
  31. int86(0x21,®s,®s);
  32. }
  33.  
  34.  
  35. void get_qth (char far *call,char far *buffer);
  36.  
  37. void interrupt handler(bp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flags)
  38. {
  39. char far *arg1, far *arg2;
  40. static savepsp;
  41. savepsp=mygetpsp();
  42. mysetpsp(_psp);
  43. arg1=MK_FP(ax,bx);
  44. arg2=MK_FP(cx,dx);
  45. get_qth(arg1,arg2);
  46. mysetpsp(savepsp);
  47. }
  48.  
  49.  
  50.  
  51. int main(int argc, char *argv)
  52. {
  53.  
  54. /* install the new interrupt handler */
  55. setvect(INTR, handler);
  56.  
  57. keep(0, (_SS + ((_SP +2048)/16) - _psp));
  58. return 0;
  59. }
  60.  
  61. void get_qth (char far *call,char far *buffer)
  62. {
  63. strcpy(buffer,call);
  64. strcat(buffer," not found\n");
  65. }
  66.